package entity;

import java.util.Collection;
import javax.ejb.CreateException;
import javax.ejb.EJBLocalHome;
import javax.ejb.FinderException;
import transfer.User;
import transfer.UserRole;

/**
 *
 * @author Sergey
 */
public interface UsersLocalHome extends EJBLocalHome {

    public Collection findAllUsersNoAdmin() throws FinderException;

    public UsersLocal findByPrimaryKey(Integer id_address) throws FinderException;

    public UsersLocal findByLogPass(String login, String password) throws FinderException;

    public UsersLocal findByLog(String login) throws FinderException;
    
    public UsersLocal findByEmail(String email) throws FinderException;

    public boolean isLoginExists(String login);

    public boolean isEmailExists(String email);

    UsersLocal create(User user) throws CreateException;

    boolean isLoginAndPasswordExist(String login, String password);

    UsersLocal findNextWarehouseEmployee() throws FinderException;

    UsersLocal findNextCourier() throws FinderException;

    Collection findAllCustomers() throws FinderException;
    
    Collection findByRole(String roleName) throws FinderException;

    Collection findUsersForRole(UserRole role) throws FinderException;
}
